ActiveReports 8 > ActiveReports User Guide > Samples and Walkthroughs > Samples > Page Report > FPL Samples > API > Custom Resource Locator |
The Custom Resource Locator sample demonstrates a custom implementation of the resource locator to load pictures from the user's My Pictures directory. In general, you can use a resource locator in a report to find any resources that a report may require.
Sample Location
Visual Basic.NET
<User Folder>\ComponentOne Samples\ActiveReports 8\Page Reports\FPL\API\VB.NET\CustomResourceLocator
C#
<User Folder>\ComponentOne Samples\ActiveReports 8\Page Reports\FPL\API\C#\CustomResourceLocator
Runtime Features
Caution: To run this sample properly, you must have image files in your My Pictures directory. If the directory does not contain any pictures, you should add them to the folder manually. |
Project Details
Resources folder
This folder contains the Description.rtf file that contains a summarized content of the resource locator that gets displayed inside the RichTextBox control on the MainForm at runtime.
This folder also contains the NoImage.bmp image file that is used if there is no image in the My Pictures directory.
DemoReport.rdlx
MainForm
This is the main form of this sample that appears when you run the sample. This form contains the RichTextBox, the ListView and the Button controls.
The RichTextBox control displays the summarized information saved in the Description.rtf file about the resource locator and the sample.
The ListView control gets populated with the images located in the My Pictures directory; the Button control is used to generate the report with the selected image.
Right-click the form and select View Code to see how to load text in the RichTextBox control and images in the ListView control. It also contains code that displays the DemoReport.rdlx on the showReport_Click event.
MyPicturesLocator
PreviewForm
This form uses the ActiveReports Viewer control to display the DemoReport.rdlx with the selected image.
Right-click the form and select View Code to see how to load the report into the Viewer.